package com.dongdongshop.index;

import com.alibaba.dubbo.config.annotation.Reference;
import com.dongdong.pojo.TbItemCat;
import com.dongdong.service.ItemService;
import com.fasterxml.jackson.core.SerializableString;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;

@Controller
public class IndexController {

    @Reference
    private ItemService itemService;

    @RequestMapping("index")
    public String index(){
        return "/shoplogin";
    }

    @RequestMapping("login")
    public String login(){
        return "/register";
    }

//    协议
    @RequestMapping("sampling")
    public String sampling(){
        return "/sampling";
    }

    @RequestMapping("goodsedit")
    public String goodsedit(Model m){
        List<TbItemCat> itemCatList = itemService.selectAll();
        m.addAttribute("item",itemCatList);
        return "admin/goods_edit";
    }
}
